package com.lahuan.controller;


import com.lahuan.demo.entity.AccountUsd;
import com.lahuan.demo.service.AccountRmbService;
import com.lahuan.demo.service.AccountUsdService;
import com.lahuan.demo.service.FrozeAccountRmbService;
import com.lahuan.demo.service.FrozeAccountUsdService;
import com.lahuan.transaction.TestTransaction;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.UUID;

/**
 * @author lfy
 */
@RestController
@RequestMapping
public class TestController {

    @Autowired
    TestTransaction testTransaction;

    @GetMapping("/trans")
    public Object trans() {
        try {
            testTransaction.tryTransaction(1L,2L,new BigDecimal(7),new BigDecimal(1), UUID.randomUUID().toString());
            return "success";
        }catch (Exception ex){
            return ex.getMessage();
        }
    }


}
